<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>数组的创建方式</title>
    </head>
    <body>

        <script type="text/javascript">

            //创建数组
            var arr1 = new Array(5);
            arr1[0] = 100;
            arr1[1] = 100;
            arr1[2] = 100;
            arr1[3] = 100;
            arr1[4] = 100;
            arr1[5] = 100;
            console.log("arr1数组长度： " + arr1.length);


            var arr2 = [100, "元素2",true, 3.14];
            for(let i =0;i<arr2.length;i++){
                console.log(typeof arr2[i])
            }


        </script>

    </body>
</html>